package com.leaf.spring.y202002.day11.bio;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {

	public static void main(String[] args) {

		try (ServerSocket server = new ServerSocket(5678)) {

			// 进行阻塞
			Socket socket = server.accept();
			
			// 新建一个线程执行客户端任务
			new Thread(new ServerHandler(socket)).start();

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
